{% extends "layouts/base-fullscreen.html" %}

{% block title %} Register {% endblock %} 

<!-- Specific Page CSS goes HERE  -->
{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

    <main>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-5">
                    <div class="card shadow-lg border-0 rounded-lg mt-5">
                        <div class="card-header text-center">
                            <h3 class="text-center font-weight-light my-4">Register</h3>
                            <span class="text-center">
                                {% if msg %}
                                    {{ msg | safe }}
                                {% else %}
                                    Add your credentials
                                {% endif %} 
                            </span>                            
                        </div>
                        <div class="card-body">

                            <form role="form" method="post" action="">

                                {% csrf_token %} 

                                <div class="form-row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label class="small mb-1" for="inputFirstName">Username</label>
                                            {{ form.username }}
                                        </div>
                                        <span class="text-error">{{ form.username.errors }}</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="small mb-1" for="inputEmailAddress">Email</label>
                                    {{ form.email }}
                                </div>
                                <span class="text-error">{{ form.email.errors }}</span>
                                    
                                <div class="form-group">
                                    <label class="small mb-1" for="inputPassword">Password</label>
                                    {{ form.password1 }}
                                </div>
                                <span class="text-error">{{ form.password1.errors }}</span>

                                <div class="form-group">
                                    <label class="small mb-1" for="inputPassword">Password Check</label>
                                    {{ form.password2 }}
                                </div>             
                                <span class="text-error">{{ form.password2.errors }}</span>                   
                                    
                                <div class="form-group d-flex align-items-center justify-content-between mt-4 mb-0">
                                    <button type="submit" name="register" class="btn btn-primary">Register</button>
                                    <div class="small">
                                        <a href="{% url 'login' %}">Login</a></div>
                                </div>

                            </form>

                        </div>
                        <div class="card-footer text-center">
                            <div class="small">
                                Django SB Admin - Open-source Seed Project
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}{% endblock javascripts %}
